package rsj.api.organization;

import com.rlyy.aibase.utils.base.Box;
import common.util.BoxUtil;
import common.util.validator.ParameterConversionCheck;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rsj.api.organization.entity.UpdateIp;
import rsj.log.ModuleEnum;
import rsj.log.OperationLog;
import rsj.log.OperationTypeEnum;
import rsj.service.organization.IOrganizationService;

/**
 * 机构
 *
 * @author yuanqinglong
 * @since 2021/7/21 11:03
 */
@RestController
public class OrganizationController {

    @Autowired
    private IOrganizationService organizationServiceImpl;


    /**
     * 更新的ip地址
     *
     * @param param 参数
     * @return {@link Box}
     */
    @RequestMapping(value = "rsj_org_ip_update")
    @OperationLog(description = "修改机构ip", logType = OperationTypeEnum.UPDATE, logModule = ModuleEnum.INSTITUTIONAL_MANAGEMENT)
    public Box updateIpAddress(Box param) {
        UpdateIp updateIp = ParameterConversionCheck.parameterConversionCheckFastFail(param, UpdateIp.class);
        organizationServiceImpl.updateIpAddress(updateIp);
        return BoxUtil.successBox(param);
    }

}
